﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Camera
{
    public partial class Form1 : Form
    {
        cVideo video;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            btn_play.Enabled = false;
            btn_stop.Enabled = true;
            btn_pz.Enabled = true;
            video = new cVideo(pic_show.Handle, pic_show.Width, pic_show.Height);
            video.StartWebCam();
        }

        private void btn_stop_Click(object sender, EventArgs e)
        {
            btn_play.Enabled = true;
            btn_stop.Enabled = false;
            btn_pz.Enabled = false;
            video.CloseWebcam();
        }

        private void btn_exit_Click(object sender, EventArgs e)
        {
            video.GrabImage(pic_show.Handle, "d:\\a.bmp");
        }
    }
}
